using System;
using Spread.Common.Features.Sample;
using Spread.Common.DataStore;

namespace Spread.StickyNotes
{
    public partial class Introduction : BaseSampleControl
    {
        public Introduction()
        {
            InitializeComponent();
            Name = "Introduction";
            sheetView.Rows.Default.Height = 25;
            sheetView.Columns.Default.Width = 90;

            sheetView.DataSource = new DataService().AccessDataSource.GetNWINDData("Customers");

            sheetView.Cells[2, 3].Note = "This is a cell note that contains additional information about the contents of this cell";
            rowNumericUpDown.Maximum = sheetView.Rows.Count - 1;
            columnNumericUpDown.Maximum = sheetView.Columns.Count - 1;
            cboNoteStyle.Items.AddRange(Enum.GetNames(typeof(FarPoint.Win.Spread.NoteStyle)));
            cboNoteStyle.SelectedIndex = (int)FarPoint.Win.Spread.NoteStyle.PopupNote;
        }
        private void addButton_Click(object sender, EventArgs e)
        {
            sheetView.Cells[(int)rowNumericUpDown.Value, (int)columnNumericUpDown.Value].Note = commentTextBox.Text;
            sheetView.Cells[(int)rowNumericUpDown.Value, (int)columnNumericUpDown.Value].NoteStyle = (FarPoint.Win.Spread.NoteStyle)cboNoteStyle.SelectedIndex;
        }
    }
}


//
//Introduction.Designer.cs
//


namespace Spread.StickyNotes
{
    partial class Introduction
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.spread = new FarPoint.Win.Spread.FpSpread();
            this.sheetView = new FarPoint.Win.Spread.SheetView();
            this.rowLabel = new System.Windows.Forms.Label();
            this.columnLabel = new System.Windows.Forms.Label();
            this.rowNumericUpDown = new System.Windows.Forms.NumericUpDown();
            this.columnNumericUpDown = new System.Windows.Forms.NumericUpDown();
            this.textLabel = new System.Windows.Forms.Label();
            this.commentTextBox = new System.Windows.Forms.TextBox();
            this.cboNoteStyle = new System.Windows.Forms.ComboBox();
            this.noteStyleLabel = new System.Windows.Forms.Label();
            this.addButton = new System.Windows.Forms.Button();
            this.pnlMain.SuspendLayout();
            this.pnlControls.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.spread)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.sheetView)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.rowNumericUpDown)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.columnNumericUpDown)).BeginInit();
            this.SuspendLayout();
            // 
            // pnlMain
            // 
            this.pnlMain.Controls.Add(this.spread);
            // 
            // pnlControls
            // 
            this.pnlControls.Controls.Add(this.noteStyleLabel);
            this.pnlControls.Controls.Add(this.cboNoteStyle);
            this.pnlControls.Controls.Add(this.addButton);
            this.pnlControls.Controls.Add(this.commentTextBox);
            this.pnlControls.Controls.Add(this.textLabel);
            this.pnlControls.Controls.Add(this.columnNumericUpDown);
            this.pnlControls.Controls.Add(this.rowNumericUpDown);
            this.pnlControls.Controls.Add(this.columnLabel);
            this.pnlControls.Controls.Add(this.rowLabel);
            // 
            // spread
            // 
            this.spread.Dock = System.Windows.Forms.DockStyle.Fill;
            this.spread.Location = new System.Drawing.Point(0, 0);
            this.spread.Name = "spread";
            this.spread.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
            this.sheetView});
            this.spread.Size = new System.Drawing.Size(477, 487);
            this.spread.TabIndex = 0;
            // 
            // sheetView
            // 
            this.sheetView.Reset();
            this.sheetView.SheetName = "Introduction";
            // Formulas and custom names must be loaded with R1C1 reference style
            this.sheetView.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;
            this.sheetView.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
            // 
            // rowLabel
            // 
            this.rowLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.rowLabel.Location = new System.Drawing.Point(17, 23);
            this.rowLabel.Name = "rowLabel";
            this.rowLabel.Size = new System.Drawing.Size(123, 18);
            this.rowLabel.TabIndex = 0;
            this.rowLabel.Text = "Row Index";
            // 
            // columnLabel
            // 
            this.columnLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.columnLabel.Location = new System.Drawing.Point(17, 91);
            this.columnLabel.Name = "columnLabel";
            this.columnLabel.Size = new System.Drawing.Size(123, 13);
            this.columnLabel.TabIndex = 1;
            this.columnLabel.Text = "Column Index";
            // 
            // rowNumericUpDown
            // 
            this.rowNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.rowNumericUpDown.Location = new System.Drawing.Point(20, 44);
            this.rowNumericUpDown.Name = "rowNumericUpDown";
            this.rowNumericUpDown.Size = new System.Drawing.Size(120, 20);
            this.rowNumericUpDown.TabIndex = 2;
            // 
            // columnNumericUpDown
            // 
            this.columnNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.columnNumericUpDown.Location = new System.Drawing.Point(20, 107);
            this.columnNumericUpDown.Name = "columnNumericUpDown";
            this.columnNumericUpDown.Size = new System.Drawing.Size(120, 20);
            this.columnNumericUpDown.TabIndex = 3;
            // 
            // textLabel
            // 
            this.textLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.textLabel.Location = new System.Drawing.Point(17, 145);
            this.textLabel.Name = "textLabel";
            this.textLabel.Size = new System.Drawing.Size(123, 13);
            this.textLabel.TabIndex = 4;
            this.textLabel.Text = "Comment Text";
            // 
            // commentTextBox
            // 
            this.commentTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.commentTextBox.Location = new System.Drawing.Point(20, 161);
            this.commentTextBox.Multiline = true;
            this.commentTextBox.Name = "commentTextBox";
            this.commentTextBox.Size = new System.Drawing.Size(120, 50);
            this.commentTextBox.TabIndex = 5;
            // 
            // noteStyleLabel
            // 
            this.noteStyleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.noteStyleLabel.AutoSize = true;
            this.noteStyleLabel.Location = new System.Drawing.Point(17, 234);
            this.noteStyleLabel.Name = "noteStyleLabel";
            this.noteStyleLabel.TabIndex = 6;
            this.noteStyleLabel.Text = "Note Style";
            // 
            // cboNoteStyle
            // 
            this.cboNoteStyle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cboNoteStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboNoteStyle.Location = new System.Drawing.Point(20, 249);
            this.cboNoteStyle.Name = "cboNoteStyle";
            this.cboNoteStyle.Size = new System.Drawing.Size(120, 23);
            this.cboNoteStyle.TabIndex = 7;
            // 
            // addButton
            // 
            this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.addButton.Location = new System.Drawing.Point(20, 279);
            this.addButton.Name = "addButton";
            this.addButton.Size = new System.Drawing.Size(120, 23);
            this.addButton.TabIndex = 8;
            this.addButton.Text = "Add Comment";
            this.addButton.UseVisualStyleBackColor = true;
            this.addButton.Click += new System.EventHandler(this.addButton_Click);
            // 
            // Introduction
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Name = "Introduction";
            this.pnlMain.ResumeLayout(false);
            this.pnlControls.ResumeLayout(false);
            this.pnlControls.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.spread)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.sheetView)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.rowNumericUpDown)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.columnNumericUpDown)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private FarPoint.Win.Spread.FpSpread spread;
        private FarPoint.Win.Spread.SheetView sheetView;
        private System.Windows.Forms.TextBox commentTextBox;
        private System.Windows.Forms.Label textLabel;
        private System.Windows.Forms.NumericUpDown columnNumericUpDown;
        private System.Windows.Forms.NumericUpDown rowNumericUpDown;
        private System.Windows.Forms.Label columnLabel;
        private System.Windows.Forms.Label rowLabel;
        private System.Windows.Forms.ComboBox cboNoteStyle;
        private System.Windows.Forms.Label noteStyleLabel;
        private System.Windows.Forms.Button addButton;
    }
}
